﻿package 
{
	import com.hellord.ArmoryTools.ArmoryLoader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	
	/**
	 * ...
	 * @author Matteo Cappelloni
	 */
	public class Main extends Sprite 
	{
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			trace("sending")
			var id:uint = 49623;
			var loader:ArmoryLoader = new ArmoryLoader();
			loader.getItem(id);
			loader.addEventListener("armory_load", display);
		}
		public function display(e:Event):void
		{
			visual.text = "Arrivato";// e.data;
		}
	}
	
}